package com.xw.comm.entity.run;

/**
 * 基础对象的一些状态
 *
 * @author ：xiongwei
 * @date ：Created in 2021/9/25 21:42
 */
public enum BaseObjectStateEnum {

    /**
     * 战斗状态或者非战斗状态
     */
    RUN_FIGHT("行走中战斗", 1),
    RUN_NON_COMBAT("行走中非战斗", 2),
    RUN_RELEASE("施放中", 3),
    STATIC_OVER("打完结束中", 4),
    STATIC_OTHER("其他结束", 5),
    DISAPPEAR_ENTER_MAP("进图中", 6),
    DISAPPEAR_OTHER("其他原因消失", 7);

    private String name;
    private int index;

    BaseObjectStateEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public static String getBaseObjectState(int index) {
        for (BaseObjectStateEnum state : BaseObjectStateEnum.values()) {
            if (state.getIndex() == index) {
                return state.getName();
            }
        }
        return DISAPPEAR_OTHER.getName();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
